package nju.bishe.weibo;

import weibo4andriod.User;
import weibo4andriod.WeiboException;
import nju.bishe.weibo.ui.base.WithHeaderActivity;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

public class Invite  extends WithHeaderActivity{
	private static final String LAUNCH_ACTION = "nju.bishe.weibo.FOLLOWERS";
	private User profileInfo;// 用户信息
	
    @Override
    public void onCreate(Bundle savedInstanceState){
    	super.onCreate(savedInstanceState);    	
    	String msg;
		try {
			profileInfo = getApi().getAuthenticatedUser();
			msg = "Hi,"+ "\n"+
			            "我正在使用新浪微博" + "\n" +
			            "我的昵称是" +profileInfo.getName() + "\n"+
			            "我的网页是" +profileInfo.getURL() + "\n"+
			            "快来关注我吧" + "\n"+
			            "该用户通过android客户端：【南大微博控】 发送";

	        Uri smsToUri = Uri.parse("smsto:123456"); 
	        Intent sendIntent = new Intent(Intent.ACTION_VIEW, smsToUri); 

	        sendIntent.putExtra("sms_body", msg); 

	        sendIntent.setType("vnd.android-dir/mms-sms"); 

	        startActivity(sendIntent);
		} catch (WeiboException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
}
